package org.example;

// 第一章挑战
class SyntaxFixChallenge implements CodeChallenge {
    private String description;

    public SyntaxFixChallenge(String desc) {
        this.description = desc;
    }

    @Override
    public String getDescription() {
        return "修复以下代码中的语法错误:\n"
                + "public class Test {\n"
                + "    public static void main(String[] args) {\n"
                + "        System.out.println(\"Hello\") // 这里缺少分号\n"
                + "    }\n"
                + "}";
    }

    @Override
    public String getHint() {
        return "Java语句需要以分号结尾";
    }

    @Override
    public boolean validateSolution(String code) {
        return code.contains("System.out.println(\"Hello\");");
    }
}
